﻿<UserControl x:Class="SeismicResponseSpectrum.Ui.ThreeCharts"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ui="clr-namespace:SeismicResponseSpectrum.Ui"
             xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
             mc:Ignorable="d" 
             d:DesignHeight="439" d:DesignWidth="619">

    <UserControl.Resources>
        <DataTemplate x:Key="RecordTemplate">
            <ui:SeismicRecordControl />

        </DataTemplate>
       <Style x:Key="GridSplitterPreviewStyle">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Fill="#80000000" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="GridSplitterStyle1" TargetType="{x:Type GridSplitter}">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
            <Setter Property="PreviewStyle" Value="{StaticResource GridSplitterPreviewStyle}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GridSplitter}">
                        <Grid RenderTransformOrigin="0.5,0.5">
                        	
                            <Grid.ColumnDefinitions>
                                
                               
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Border BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{TemplateBinding Background}" Grid.ColumnSpan="3" />
                            <Border x:Name="dash_line" Grid.Column="1" HorizontalAlignment="Stretch" Height="Auto"
                                    VerticalAlignment="Stretch" BorderThickness="0,1,0,0">
                                <Border.BorderBrush>
                                    <DrawingBrush Viewport="0,0,8,8" ViewportUnits="Absolute" TileMode="Tile">
                                        <DrawingBrush.Drawing>
                                            <DrawingGroup>
                                                <GeometryDrawing Brush="Gray">
                                                    <GeometryDrawing.Geometry>
                                                        <GeometryGroup>
                                                            <RectangleGeometry Rect="0,0,50,50" />
                                                            <RectangleGeometry Rect="50,50,50,50" />
                                                        </GeometryGroup>
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                            </DrawingGroup>
                                        </DrawingBrush.Drawing>
                                    </DrawingBrush>
                                </Border.BorderBrush>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    
    <Grid x:Name="ChartsGrid" >

        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>


        <d3:ChartPlotter x:Name="AccelerationCharts" Margin="5,5,5,4.312" PreviewMouseUp="AccelerationCharts_PreviewMouseUp">
            <d3:VerticalAxisTitle Content="Max(a)/PGA" />
            <d3:HorizontalAxisTitle Content="T (sec)" />
        </d3:ChartPlotter>

        <GridSplitter HorizontalAlignment="Stretch" Background="#02F0F0F0"
			Style="{DynamicResource GridSplitterStyle1}" Grid.Row="1" VerticalAlignment="Center"  />

        <d3:ChartPlotter x:Name="VelocityCharts" Margin="5,5,5,3.708" Grid.Row="2" PreviewMouseUp="VelocityCharts_PreviewMouseUp">
            <d3:VerticalAxisTitle Content="Max(v)/PGV" />
            <d3:HorizontalAxisTitle Content="T (sec)" />
        </d3:ChartPlotter>

        <GridSplitter HorizontalAlignment="Stretch" Background="#02F0F0F0"
			Style="{DynamicResource GridSplitterStyle1}" Grid.Row="3" VerticalAlignment="Center" />
        
        <d3:ChartPlotter x:Name="DisplacementCharts" Margin="5" Grid.Row="4">
            <d3:VerticalAxisTitle Content="Max(d)/PGD" />
            <d3:HorizontalAxisTitle Content="T (sec)" />
        </d3:ChartPlotter>
        <ui:StretchButton x:Name="accelerationStretchBtn" Height="50" Margin="0,10,10,0" Width="50" Grid.Row="2"
				ToolTip="Stretch chart into visible area" MouseDown="VelocityStretchButton_MouseDown_1"  Grid.Column="0"/>
        <ui:StretchButton Height="50" Margin="0,10,10,0" Width="50" Grid.Row="4"
				ToolTip="Stretch chart into visible area" MouseDown="DisplacementStretchButton_MouseDown"  Grid.Column="0"/>

        <ui:TutorialLayer x:Name="Tutorials" Grid.Row="0" Grid.Column="0" Grid.RowSpan="5" Visibility="Collapsed" />

        <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Right">
        	
			<ui:CustomGraphLegend x:Name="stkLegends" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,0,0" Visibility="Collapsed" />
			<ui:StretchButton Height="50" Width="50" ToolTip="Stretch chart into visible area" MouseDown="AccelerationStretchButton_MouseDown" VerticalAlignment="Top"/>
			
        </StackPanel>
        <Image Grid.Row="5" HorizontalAlignment="Right" Source="Images/cam.png" ToolTip="Take Screen Shot" Cursor="Hand" MouseDown="UIElement_OnMouseDown"/>
        <Button x:Name="btnExtraStuff" Content="Hide Stuff!" HorizontalAlignment="Left" Margin="519,0,0,0" Grid.Row="5" VerticalAlignment="Top" Width="75" Click="Button_Click"/>

    </Grid>
</UserControl>
